package cur.nature.component.redis.common;

import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.DependsOn;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
@DependsOn("redissonClient")
@ConditionalOnProperty( value = {"cur.component.redis.enable"})
public class LockUtil {

    private static RedissonClient redissonClient;

    private LockUtil(@Qualifier("redissonClient") RedissonClient redissonClients) {
        redissonClient = redissonClients;
    }

    public static RedissonClient get() {
        return redissonClient;
    }

}
